<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" isELIgnored="false" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>

<html xmlns="http://www.w3.org/1999/xhtml">
<!-- /*
 * @xiaozhi
 * Email:ganhongzhi@foreveross.com
 * this is 运价监控设置示
*/ -->
<head>
<%@ include file="/include/header.jsp"%>
<title><s:text name="monitor.showTitle"/></title>
<link rev="stylesheet" media="all" href="<%=request.getContextPath() %>/fare/css/form_style.css" type="text/css" rel="stylesheet">
<link href="<%=request.getContextPath()%>/fare/css/base.css" rel="stylesheet" type="text/css" />
 <%-- <script type="text/javascript" src="<%=request.getContextPath()%>/fare/js/jquery-1.6.4.min.js"></script> --%> 
<%-- <script type="text/javascript" src="<%=request.getContextPath()%>/fare/js/jquery-validation/jquery-1.7.2.js"></script> --%>

<link rel="stylesheet" type="text/css" href="/mofangtest/fare/css/form_style.css" media="all" rev="stylesheet">
<link href="<%=request.getContextPath() %>/fare/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<script type="text/javascript"	src="<%=request.getContextPath() %>/fare/lib/ligerUI/js/ligerui.all.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/fare/lib/ligerUI/js/plugins/ligerGrid.js" ></script> 
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/fare/channelTariffs/css/style_2.css"/>
<script	src="<%=request.getContextPath()%>/fare/js/ligerUI/js/plugins/ligerDialog.js"	type="text/javascript"></script>
<script type="text/javascript"	src="<%=request.getContextPath() %>/FusionCharts/FusionCharts.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/jsFile/common.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/jsFile/multiblepicker.js"></script>
<script type="text/javascript"	src="<%=request.getContextPath()%>/fare/js/menu.js"></script> 
<script type="text/javascript"	src="<%=request.getContextPath()%>/fare/js/json2.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/fare/js/checkIE.js"></script><!--检测IE-->
<link href='<%=request.getContextPath()%>/fare/lib/huadong/css/huadong2.css' rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/fare/js/button.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/fare/lib/huadong/js/huadong.js"></script>
<link href="<%=request.getContextPath() %>/fare/css/base.css" rel="stylesheet" type="text/css" />


<style type="text/css">

<%--  .char_bg{
	background:url("<%=request.getContextPath()%>/images/char_bg.png") no-repeat left top;
	float:left;
	width:600px;
}  --%>

.absolute_div{
position:absolute;
left:400px;
top:430px;
}

.ahover{
	display:block;
	width:64px;
	padding-top:10px;
	background:#535353;
	color:#FFF;
}

#showGABsNum td {
 text-align: center;
} 
.akill {poorfish:expression(this.onclick=function kill(){
			return false;
		}
	)}
	
#playNum li.on { background:#FEE9CA;} 

/*//切换TAB  */
#tabl_con_c ul,#tabl_con_c div, #tabl_con_c li{padding:0;margin:0;z-index:990;}
#tab li {float:left;width:100px;height:30px;line-height:30px;text-align:center;z-index:990;background-color:#fff;border:1px #bbb solid;border-bottom:none;}
ul li.fli {background-color:#ccc;color:red;}
 ul.tab_c{overflow:hidden;zoom:1;list-style-type:none;}
#tab_con {width:900px;height:350px;}
#tab_con div {display:none;border:none #bbb solid;border-top:none;}
#tab_con div.char_bg2 {display:block;}


	
</style>

<script>

function currentDate(){
    var now = new Date();       
    var year = now.getFullYear();
    var month = now.getMonth() + 1;
    var day = now.getDate();
   
    var today = year + "-";       
    if(month < 10)
        today += "0";       
    today += month + "-";       
    if(day < 10)
        today += "0";           
    today += day;       
    return(today); 
}

</script>
</head>
<body  >
<%@ include file="/include/home/home_header.jsp" %>
	<jsp:include page="/pages/system/feedback/feedback.jsp" ></jsp:include>
  <div class="absolute_div" id="flight_select" style="position:relative; z-index:300; display:none;">
		<select name="flight_sel" id="flight_sel">
		<option >--<s:text name="share.select"/>--</option>
		</select>
	</div>
<div class="main_max">
 
<!--  <div class="high_10"></div> -->
<%-- <div class="nav_bg" style="display:none">
<div class="nav" >
     <ul style=list-style:none;margin:0; >
        <!-- <li class="cur"><a href="#" class="click">全航线</a></li> <li class="cur" style="display: none"></li> -->
        <c:if test="${not empty citylist }">
			<c:forEach var="city" items="${citylist}" varStatus="stat" >
			<li id="${city.id}" class="${stat.index+1 }"><a href="javascript:void(0)"  style="cursor:hand;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline"  id="Submit${stat.index+1}">${city.fromCity}-${city.toCity }-${city.flightNumber }-${city.id }-${city.opDate }-${city.departDate }
			</a> 
			<!-- <a href="#" onclick="delPopularRoutes('${city.id}')"><img src="${pageContext.request.contextPath}/fare/images/close.gif" border="0" /></a> -->
			</li>
			</c:forEach>
		</c:if>
		<c:if test="${empty citylist }">
			<c:forEach var="itemsPopularRoutes" items="${citylist}" varStatus="stat">
	        <li  id="prli${stat.index+1}" class="${stat.index+1}"><a href="javascript:void(0)"  style="cursor:hand;display:inline;white-space:nowrap;text-overflow:ellipsis;overflow:hidden" 
			  id="Submit${stat.index+1}">${citylist.fromCity}-${citylist.toCity}-${citylist.flightNumber }-${citylist.id}-${citylist.opDate}-${city.departDate}
			</a> 
	        </li>
	  	    </c:forEach>
		</c:if>
    </ul> 
    <div class="curBg"></div>
    <div class="cls"></div>
</div>
</div>  --%>
<form id="ctform" name="ctform" method="post">
<input type="hidden" name="fromCity" id="fromCity" />
<input type="hidden" name="toCity" id="toCity" />
<input type="hidden" name="airLine" id="airLine" />
<input type="hidden" name="opDate" id="opDate" />
<input type="hidden" name="departDate" id="departDate"/>
<input type="hidden" name="id" id="id"/>
<input type="hidden" name="flightNumber" id="flightNumber" />
<input type="hidden" name="flag" id="flag" />

<!-- internationalization  -->
<input type="hidden" id="share.flightLine" value="<s:text name="share.flightLine" />"/>
<input type="hidden" id="share.select" value="<s:text name="share.select"/>"/>
<input type="hidden" id="share.index" value="<s:text name="share.index"/>"/>
<input type="hidden" id="monitor.settingShowSpaceC" value="<s:text name="monitor.settingShowSpaceC"/>"/>
<input type="hidden" id="share.grabDate" value="<s:text name="share.grabDate"/>"/>
<input type="hidden" id="share.flightDate" value="<s:text name="share.flightDate"/>"/>
<input type="hidden" id="share.total" value="<s:text name="share.total"/>"/>
<input type="hidden" id="share.flighNumber" value="<s:text name="share.flighNumber"/>"/>
<input type="hidden" id="share.add" value="<s:text name="share.add"/>"/>
<input type="hidden" id="share.del" value="<s:text name="share.del"/>"/>
<input type="hidden" id="monitor.settingShowTimes" value="<s:text name="monitor.settingShowTimes"/>"/>

</form>
</div>
<script type="text/javascript">

var indexs=document.getElementById("share.index").value;
var spaceCh=document.getElementById("monitor.settingShowSpaceC").value;
var flightDates=document.getElementById("share.flightDate").value;
var grabDates=document.getElementById("share.grabDate").value;
var totals=document.getElementById("share.total").value;
var flightLine=document.getElementById("share.flighNumber").value;
var dels=document.getElementById("share.del").value;
var adds=document.getElementById("share.add").value;
var times=document.getElementById("monitor.settingShowTimes").value;
var funshCharResults;
var batchResult  = 0;
var maxBatch = 0;
	var COUNT=0;
	var managers;
	var url = "<%=request.getContextPath()%>/freightMonitorShowsAction!analyseBarCharts.action";
	$(function(){
		manager=huadong("huadong_menu_div");
		
		$("#flight_sel").bind('change',function(){
			var flightNo =$("#flight_sel").val();
			if(flightNo!=""){
				lowPrice(flightNo);
			}
			
		});
		
		
	// 	var $j = jQuery.noConflict();/* 这个很重要的，如果删除后面的ligerUI就用不了  释放“$”符号给其它JS库*/
	 	/* var $jq = jQuery.noConflict(true); */
		     managers=$("#re").ligerGrid({
			    dataAction : 'server',
			    title:spaceCh,
			    showTitle:false,	
			 	url:url,
			    columns:[
				{ display: indexs, name: 'rowId', width: 40, 
					render: function(rowData, index) { 
						return (this.options.page-1)*this.options.pageSize+index+1;//分页page,pageSize
						//return index+1;
					} 
				}, 
				{ name: 'flightDate', display: flightDates, align:'center',width:160},
				{ name:'flightNo',display:flightLine, align:'center',width:100},
				{ name: 'grabDate', display: grabDates, align:'center',width:145},
				{ name: 'grabNum', display: times, align:'center',width:130},
				{ name:'cabinNumForAdd',display: adds, align:'center',width:130,
					render: function(rowData) { 
						var v = rowData.cabinNumForAdd;
						return "<font color="+(v != 0 ? "red" : "")+">"+v+"</font>";
					} 
				},
				{ name:'cabinNumForDel',display:dels,align:'center',width:130,
					render: function(rowData) { 
						var v = rowData.cabinNumForDel;
						return "<font color="+(v != 0 ? "red" : "")+">"+v+"</font>";
					} 
				},
				{ name:'cabinNum',display:totals,align:'center',width:130}
				],	
			    height: '470',
		        width: '988',
		        usePager:false,
		        AllowPaging:false,
		        pageSizeOptions : [20,30,50,100],
				pageSize:20, 
				pagesizeParmName:'pagesize' ,
				 rownumbers:false,
				 heightDiff: 100,
				 onAfterShowData: function(){mergecell("#re", "c102");}
		 	});
		     
		    $(".HUADONG li a").click(function(e){
		    	var id = $(this).parent("li").attr("id");
		   		checkJspForm(id);
		    }); 
		    //默认触发显示第一个图表
		    if($(".HUADONG li a") && $(".HUADONG li a").eq(0)) $(".HUADONG li a").eq(0).click();
		    
		showMessageFlightinfo();
		
		
		$("#tab li").click(function(){
			$("#tab_con div").removeClass("char_bg2");
			$("#tab li").removeClass("fli");
			$(this).addClass("fli");
			$("#tab_con div").eq($(this).attr("idx")).addClass("char_bg2");
			
			$("#chartDiv_lowPrice").hide();
			var idname = $(this).attr('id');
			if(idname=="hightPrice" ){
				$("#flight_select").hide();
			}else{
				$("#flight_select").show();
			}
		});
		
		 $(".next").click(function(){
			 if(batchResult >= maxBatch) return;
			 batchResult++;
			 var len = funshCharResults.length;
			 		$("#bar_chart").html("");
			 		$("#bar_chart2").html("");
			 		$("#bar_chart3").html("");
			     	setChart(funshCharResults[len-(batchResult-1)*3-3].xml);
					setChart2(funshCharResults[len-(batchResult-1)*3-2].xml2);
			     	setChart3(funshCharResults[len-(batchResult-1)*3-1].xml3);
		 });
		 $(".prev").click(function(){
			 if(batchResult <= 1) return;
			 batchResult--;
			 var len = funshCharResults.length;
			 
			 		$("#bar_chart").html("");
			 		$("#bar_chart2").html("");
			 		$("#bar_chart3").html("");
			     	setChart(funshCharResults[len-(batchResult-1)*3-3].xml);
					setChart2(funshCharResults[len-(batchResult-1)*3-2].xml2);
			     	setChart3(funshCharResults[len-(batchResult-1)*3-1].xml3);
		 });
		
		setInterval("showChartsBytime()",600000); 
			
	});
	
	//滑动块之后选择，并显示报表
	function checkJspForm(obj){	
		var airLines=document.getElementById("share.flightLine").value;
		 //ligerUI
		managers.set('parms', {id: obj}); 
	    //采用原来的请求地址，带上参数加载数据
	    managers.loadData();
	    
		var ss =$("#cityFlightNo"+obj).val().split("-");
		$("#fromCity").val(ss[0]);
		$("#toCity").val(ss[1]);	
		$("#flightNumber").val(ss[2]);
		$("#id").val(ss[3]);
		$("#opDate").val(ss[4]);
		$("#departDate").val(ss[5]);
	    $("#barChartText").text(currentDate()+"  "+ $('#fromCity').val()+"-"+$('#toCity').val());
		var setIntoId=$("#id").val();
		//保存ID
		saveID(setIntoId);
		
		$("#messages").text(airLines+" "+ $('#flightNumber').val());//滑动附带信息
	    var flightNumberList=$('#flightNumber').val();
		showFlightNO(flightNumberList);//生成航班select下拉框 
		loadAndDisplayBarData($("#maingrid"),"freightMonitorShowsAction!analyseBarChart2.action?id="+obj);

		/* 隐藏航班舱位最低价报表*/
	    $("#chartDiv_lowPrice").hide();
	}
	
	//动态存储ID号
	function saveID(id){
		document.getElementById('saveIDs').value = "";
	//  var getSaveId=document.getElementById('saveIDs').value;
		document.getElementById('saveIDs').value=id;
		
	}
	
	
	//产生一个简单的遮罩层拉
	function showWait(e,f){
		
		if($(e)[0]==undefined){return;}
		if($(e)[0].SHOWING==true){return;}
		
		if(true){//为了照顾IE迫不得已改代码
			var obj=document.createElement("DIV");
			var img=document.createElement("DIV");
			$(obj).css({
				"display":'none',
				'position':'absolute',
				'opacity':'0.3',
				'background-color':'#ECECEC',
				'width':$(e).width()+'px',
				'height':$(e).height()+'px',
			});
			$(img).css({
				'display':'none',
				'position':'absolute',
				'width':$(e).width()+'px',
				'height':$(e).height()+'px',
				'background-image':"url('<%=request.getContextPath()%>/images/blue-loading.gif')",
				'background-repeat':'no-repeat',
		    	'background-position':'center center',
		    	'z-index':'9990'
			});
			if(f==true){
				$(obj).css({"opacity":"0"});	
				$(img).css({"opacity":"0"});
			}
			obj.img=img;
			$(e)[0].obj=obj;
		}
		$(e).prepend($(e)[0].obj.img);
		$(e).prepend($(e)[0].obj);
		$($(e)[0].obj).css("display",'block');
		$($(e)[0].obj.img).css("display",'block');
		$(e)[0].SHOWING=true;
	}

	function hideWait(e){
		if($(e)[0]==undefined){return;}
		if($(e)[0].SHOWING!=true){return;}
		$($(e)[0].obj).css("display",'none');
		$($(e)[0].obj.img).css("display",'none');
		$(e)[0].SHOWING=false;
		
	}
	
	function mergecell(gridid, columnid) //参数:表格id和列索引关键字，根据表格具体值来动态合并单元格
    {
        var i, j, k, x;
        i = -1; k = 1; j = ""; x = 0;
        var cellname = "";
        $("td[id$='|" + columnid + "']", gridid).each(
               function() {
                   if (j == $("div", this).text()) {
                       $(this).addClass("l-remove");
                       k++;
                       $("td[id='" + cellname + "']", gridid).attr("rowspan", k.toString());
                   }
                   else {
                       j = $("div", this).text();
                       var a = $(this);
                       cellname = a.attr("id"); //得到点击处的id                            
                       k = 1;
                       x = i;
                   }
                   i++;
               });
        $(".l-remove").remove();
    }
	
</script>


<!--  *********************************************************************************************  -->
 <div class="main_max">
	<div class="sideBar">
		<div class="box">
			<div class="location"><s:text name="forms.position"/>： <s:text name ="fareInquiry"/> &gt;<s:text name ="faremonitor"/></div>
		</div>
	</div>
 <div id="huadong_menu_div" class="HUADONG">
			
			<ul class="sumbitShow">
			 <c:if test="${not empty citylist }">
			 <c:forEach var="city" items="${citylist}" varStatus="stat" >
			 	<input type="hidden" name="cityFlightNo" id="cityFlightNo${city.id}" value="${city.fromCity}-${city.toCity }-${city.flightNumber }-${city.id }-${city.opDate }-${city.departDate }"/>
				<li id="${city.id}" idx="${stat.index+1}">
				<a href="javascript:void(0)"  
					id="Submit${stat.index+1}"
					 class="showMessage" onmouseover="showMessageFlightinfoJS(this,'hellos');"	 onmouseout=closeInfo();>${city.fromCity}-${city.toCity }
				</a>
				</li>
			 </c:forEach>
			 </c:if>
			 
			  <c:if test="${empty citylist }">
				  <c:forEach var="city" items="${citylist}" varStatus="stat">
				  
		       	  <li id="prli${stat.index+1}" idx="${stat.index+1}">
		       	    <a href="javascript:void(0)" 
						id="Submit${stat.index+1}"  class="showMessage"  onmouseover="showMessageFlightinfoJS(this,'hellos');"	onmouseout=closeInfo();>${citylist.fromCity}-${citylist.toCity}
		          </a>
		          </li>
		  	      </c:forEach>
			  </c:if>
			</ul>
</div>
<div>
<ul><li id="flightZone"></li>
	<li id="airLines"></li>
	<li id="flightDates"></li>
	<li id="createDateTime"></li>
</ul></div>

<div id="tabs" class="tabs_c" style=" z-index:300"> 
 	<ul id="tab" class="tab_c" style=" z-index:300">
 	<li class="fli" id="cabinNum" idx="0" style="cursor: pointer;"><s:text name="monitor.settingShowSpaceNumber"/></li>
 	<li class="" id="lowPrice" idx="1" style="cursor: pointer;"><s:text name="monitor.settingShowLowest"/></li>
 	<li class="" id="hightPrice" idx="2" style="cursor: pointer;"><s:text name="monitor.settingShowHighest"/></li>
	</ul>
 <!--  </div> -->
 <div id="tab_con" class="tabl_con_c" style=" z-index:990"> 
 
 
 <div id="bar_chart" class="char_bg2" idx="" style="width:100%;height:350px;">
   
 </div> 
 <div id="bar_chart2" class="" ></div>
  <div id="bar_chart3" class="" ></div> 
  <a class="rslides_nav rslides1_nav next" >Next</a>
 	<a class="rslides_nav rslides1_nav prev" >Previous</a>
  </div>
 </div>
 


   <!-- 存放舱位数据的DIV -->
 <div id="re" align="center" style="width: 400;margin-top: 20px" ></div>
 
 <!-- 存储临时ID号  和   SET个数用来判断报表是否有数据变化-->
 <div id="saveID" class="" style="display:none">
 <input id="saveIDs" type="hidden" name="svaeIDs" value="1" />
 <input id="maxGrabNum" type="hidden" name="maxGrabNum" value="0"/>
 </div>
 
  <!-- 航班舱位级别最低价/航班子舱价格分布 -->
<div id="chartDiv_lowPrice" align="center" class="char_bg2" style="margin-top: 20px;width:100%;height:400px;display: none;"></div>
</div>

 <div class="clear"></div>
<%-- <jsp:include page="/inc/footer2.jsp"></jsp:include> --%>
<%@ include file="/include/home/home_footer.jsp" %> 
 
 <script language="JavaScript">
 
//自动刷新并加载报表 
	function showChartsBytime(){
		var ids=$('#saveIDs').val();
		var maxGrabNum=$('#maxGrabNum').val();
	//	alert("maxGrabNum=="+maxGrabNum);
		var urlss="<%=request.getContextPath()%>/freightMonitorShowsAction!reloadOR.action";
		$.ajax({
			url:urlss,
			data:{
				id:ids,
				maxGrabNum:maxGrabNum,
			},
			cache : false, 
	        async : true,
	        type : "POST",
	        dataType:"json",
		    beforeSend:function(){ },
		    success:function(result){
		    //	alert("do");
		    	var results=result[0].doIt;
		    	if(results=='success'){
		    		checkJspForm(ids);
		    	} 
		    },
		    error:function(){
		   //		alert("执行错误...");
		    },
		    complete:function(result){
		    	//alert("do it");
		    	/* var results=result[0].doIt;
		    	if(results=='success'){
		    		checkJspForm(ids); */
		    	//	clearTimeout(ids);
		    //	}
		    }
		});
	}
 
//动态生成select
 function showFlightNO(data){
	   var selectS=document.getElementById("share.select").value;
	   var idname = $('div .fli').eq(0).attr('id');
		if(idname=="hightPrice" || idname=='lowPrice'){
			$("#flight_select").hide();
		}else{
			$("#flight_select").show();
		}
	  	 $("#flight_sel option").remove();
		//$("#selectFlightNo").html('');
		//$("#selectFlightNo").append('<ul id="flight_No"></ul>');
		if(data && data.length>0){
			var flightLineGet= new Array();
			flightLineGet=data.split("/");
			$("#flight_sel").append('<option value="">--'+selectS+'--</option>');
			for(var i=0;i<flightLineGet.length;i++){
					$("#flight_sel").append("<option value='"+flightLineGet[i]+"'>"+flightLineGet[i]+"</option>");
					//var ids="flight_"+i;
					//$("#flight_No").append('<li><a href="javascript:void(0)" id="'+ids+'" onclick="javascript:lowPrice(\''+flightLineGet[i]+'\');">'+flightLineGet[i]+'</a></li>');
		}
		//	$('#selectFlightNo .HUADONG_selDiv').remove();
		//	manager1=huadong("selectFlightNo");
	}
	
}

 function lowPrice(flightNo){
		var ids=$("#id").val();
		var idname = $('div .fli').eq(0).attr('id');
		if(flightNo!="" || flightNo!=null){
			if(idname =='cabinNum'){
				var url ="<%=request.getContextPath() %>"+"/freightMonitorLowPriceForFlightInfoAction!findPriceForFlightInfoByCabinNameXML.action";
				lowPriceForForCabinType(ids,flightNo,url);
			}else if(idname == 'lowPrice'){
				var url ="<%=request.getContextPath() %>"+"/freightMonitorLowPriceForFlightInfoAction!findLowPriceForFlightInfoXML.action";
				lowPriceForForCabinType(ids,flightNo,url);
			}else if(idname == 'hightPrice' || idname=='lowPrice'){
				//alert("对不起，目前还没航班有最高价价格分布报表");
				$("#chartDiv_lowPrice").hide();
			}
		}
	}
 
 //显示信息
 function showMessageFlightinfo(){
	/*  var Event = event;
	 var div = $(".showMessage");
	 div.top = ;
	 $(div). */
	 $(".showMessage").append('<div class="messageDiv" id="messageDiv"  style="display: none; left: 0px; position: absolute; TOP: 0px"><dd class="messages" id="messages"  ></dd></div> ');
	 
 }
 var dt=0;
 function showMessageFlightinfoJS(objT,strContent){
	 	
		var p = $(objT);
		var offset = p.offset();
		var objBox = $('#messageDiv');
		var objText = $('.messages');
		if(dt == 0){
			objBox.show("fast",function (){dt=0});
			objBox.css("left", p.attr("width") + offset.left + 5);
			objBox.css("top",offset.top);
			objText.html(strContent);
			dt = 1;
		}
 }
 
 function  closeInfo(){
		var objBox = $('#messageDiv');
		objBox.hide("fast");
	}

	//航班舱位级别最低价的报表
	function lowPriceForForCabinType(id,flightNo,url){
		 var urls =url;
		 var data = {"id":id,"flightNuber":flightNo};
		 $.ajax({
				url:urls,
				data:data,
				type : "POST",
				cache : false, 
				async : true,
			    dataType:'html',
			    beforeSend:function(){
			    	$("#chartDiv_lowPrice").show();
			    	$("#flight_sel").attr("disabled","disabled");
			    },
			    success:function(data){
			    	if(/<set/.test(data)){
			    		//MSLine
			    		var chart = new FusionCharts("<%=request.getContextPath() %>/FusionCharts/MSLine.swf", "chartID", '990', "100%");
			    		chart.setDataXML(data);
			    		chart.setTransparent(true);
						chart.render("chartDiv_lowPrice");
						$("#flight_sel").removeAttr("disabled");
			    	}else{
			    		$('#chartDiv_lowPrice').html('<br/><br/><b><center>没有符合当前查询条件的数据!</center></b>');
			    	};
			    },
			    error:function(){ 
			    	alert("查询失败，请联系管理员！");
			    	$("#chartDiv_lowPrice").hide();
			    },
			    complete:function(){
			    	$("#flight_sel").removeAttr("disabled");
			    }
			});
	}	
	

 function loadAndDisplayBarData(grid,url){	 
		
	 	if($('#fromCity').val()!=''&&$('#toCity').val()!=''){ 	 		
			$.ajax({
		        url : url,
		         data:{
		        	fromCity:$('#fromCity').val(),
		        	toCity:$('#toCity').val(),
		        	opDate:$('#opDate').val(),
		        	flightNumber:$('#flightNumber').val(),
		        	departDate:$('#departDate').val(),
		        	}, 
		        cache : false, 
		        async : true,
		        type : "POST",
		        dataType:"json",
		        beforeSend:function(){
		        	showWait($("#bar_chart"));
		        	showWait($("#bar_chart2"));
		        	showWait($("#bar_chart3"));
		        },
		        success: function(result){
		        	maxBatch = result.length/3;
		        	batchResult = maxBatch;
		        	funshCharResults = result;
		        	var j=0;
		        	var allGabNum=0;
		        	var IE_version=$.browser.version;
		        //	alert("IE_version="+IE_version);
		        	//获取Action传过的set属性值总个数，用来判断是否执行重新加载
		        	for(var i=0;i<maxBatch;i++){
		        		
		        		$(result[j].xml).find('set').each(function(){
		        			tests=$(this).attr("value");//获取属性
		        			if((tests !='undefined') && (tests !='') && (tests !=null)){
		        				allGabNum++;
		        			}
		        		});
		        		 //IE8下，不能使用find，只能用filter代替
		        		if(IE_version==8.0 ){
		        			$(result[j].xml).filter('set').each(function(){
			        			tests=$(this).attr("value");//获取属性
			        			if((tests !='undefined') && (tests !='') && (tests !=null)){
			        				allGabNum++;
			        			}
			        		});
		        		}
		        		
		        		j+=3;
		        	};	
		        	//	alert("allGabNum="+allGabNum);
		        		$('#maxGrabNum').val("");
		        		$('#maxGrabNum').val(allGabNum);
		        	//	alert("testss==="+($('#maxGrabNum').val()));
		        	
		       			var xml =result[0].xml ;
		            	var xml2=result[1].xml2;
			    		var xml3=result[2].xml3;
			    		$("#bar_chart").html("");
			    		$("#bar_chart2").html("");
			    		$("#bar_chart3").html("");
		            	setChart(xml);
	        			setChart2(xml2);
			        	setChart3(xml3);
			       	hideWait($("#huadong_menu_div"),true);
		        }
		    });
		}
 	}

	// $("#timetd4").attr("class","ssbt1 over1");
		
		function setChart(xml) {
			var width = '990';
			//ScrollStackedColumn2D滚动显示
			var chart2 = new FusionCharts("<%=request.getContextPath()%>/FusionCharts/StackedColumn2D.swf", "chart1Id", width, "350");
			chart2.setDataXML(xml);
			chart2.setTransparent(true);
		//	chart2.addParam("wmode","Opaque"); 
			chart2.render("bar_chart");	
	}
		
	function setChart2(xml){
		//MSLine ScrollLine2D
		var chart22 = new FusionCharts("<%=request.getContextPath()%>/FusionCharts/MSLine.swf", "chart2Id","990","350");
		chart22.setDataXML(xml);
		chart22.setTransparent(true);
		chart22.render("bar_chart2");
		}
	function setChart3(xml){
		var chart23 = new FusionCharts("<%=request.getContextPath()%>/FusionCharts/MSLine.swf", "chart3Id","990","350");
		chart23.setDataXML(xml);
		chart23.setTransparent(true);
		chart23.render("bar_chart3");
		}
	//点击报表，获取数据
/* 	function FC_Rendered(DOMId){
		 if (DOMId=="chart1Id"){
			 var chartObj = getChartFromId("chart1Id"); 
			 window.alert(chartObj.getDataAsCSV());
	            return;
		 }
	} */
	
	function showBar(xml,id){
		///$("#bar_chart"+id).show();
		//var xml = document.getElementById('text2').value;
		var width = '990';	
		//if(xml!=''||xml!=null){
			var chart3 = new FusionCharts("<%=request.getContextPath()%>/FusionCharts/StackedColumn2D.swf",
						"chart3Id"+id, width, "350");
				chart3.setDataXML(xml);
				chart3.setTransparent(true);
				chart3.render("bar_chart"+id);
				///$("#leaf2").val(xml);
		 ///	}
		}
		function loadSwf(xml){
			var chart2 = new FusionCharts("<%=request.getContextPath()%>/FusionCharts/StackedColumn2D.swf", "chart4Id","990","350");
			chart2.setDataXML(xml);
			chsrt2.setTransparent(true);
			chart2.render("bar_chart");
		 };
 
 </script>
<!--**********************************tab切换 js***************************************************  -->
<script type="text/javascript">
	var tabs_s =(document.getElementById('tab').getElementsByTagName('li'));
	var divs=document.getElementById("tab_con").getElementsByTagName("div");
</script>
</body>
</html>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/fare/channelTariffs/css/style_2.css"/>

<style type="text/css" media=screen>   		
	<!--
	 .sfbz_btbox a,.sfbz_btbox a span.hover{
		width:90px;
		height:82px;
		float:left;
		overflow:hidden;
		display: block;
		line-height:23px;
		font-size:14px;
		font-weight:bold;
		color:#fff;
		padding-top:21px;
	}
	.curBg {
	background: #F00 url(../images/new/nav_click.png) no-repeat;
	height: 47px;
	position: absolute;
	top: -5px;
	width: 98px;
	left: 0px;
	z-index: -1;
	}
	-->	
</style>

